<script type="text/javascript">
    $(function() {
        $( "#tabs" ).tabs();
        $("#no1a_r").buttonset();
        $("#no1b_r").buttonset();
        $("#no1c_r").buttonset();
        $("#no2_r").buttonset();
        $("#no3_r").buttonset();
        $("#no4_r").buttonset();
        $("#no5a_r").buttonset();
        $("#no5b_r").buttonset();
        $("#no6a_r").buttonset();
        $("#no6b_r").buttonset();
        $("#no7_r").buttonset();
        $("#no8_r").buttonset();
        $("#no9_r").buttonset();
        $("#no10_r").buttonset();
        $("#no11_r").buttonset();
        $("#nihss_confirm").button();
        $("#estimate_confirm").button();
        $("#estimate_i1_r").buttonset();
        $("#estimate_i2_r").buttonset();
        $("#estimate_i3_r").buttonset();
        $("#estimate_d1_r").buttonset();
        $("#estimate_d2_r").buttonset();
        $("#estimate_d3_r").buttonset();
        $("#estimate_d4_r").buttonset();
        $("#estimate_d5_r").buttonset();
        $("#estimate_d6_r").buttonset();
        $("#estimate_d7_r").buttonset();
        $("#estimate_d8_r").buttonset();
        $("#estimate_d9_r").buttonset();
        $("#estimate_d10_r").buttonset();
        $("#estimate_d11_r").buttonset();
        $("#estimate_d12_r").buttonset();
    });

    function verify(n){
        if($("#"+n+"_ra").is(":checked")){
            $("#"+n+"_tr").css('display','none');
            //$("#"+n+"_tro").css('background-color','green');
        }
        else if($("#"+n+"_ri").is(":checked")){
            $("#"+n+"_tr").css('display','table-row');
            //$("#"+n+"_tro").css('background-color','red');
        }
    }

    function verify_estimate(n){
        if($("#"+n+"_ra").is(":checked")){
            //$("#"+n+"_tro").css('background-color','green');
        }
        else if($("#"+n+"_ri").is(":checked")){
            //$("#"+n+"_tro").css('background-color','red');
        }
    }

    function onchange_nihss()
    {
        var no1a=$("select#no1a_c").val();
        var no1b=$("select#no1b_c").val();
        var no1c=$("select#no1c_c").val();
        var no2=$("select#no2_c").val();
        var no3=$("select#no3_c").val();
        var no4=$("select#no4_c").val();
        var no5a=$("select#no5a_c").val();
        var no5b=$("select#no5b_c").val();
        var no6a=$("select#no6a_c").val();
        var no6b=$("select#no6b_c").val();
        var no7=$("select#no7_c").val();
        var no8=$("select#no8_c").val();
        var no9=$("select#no9_c").val();
        var no10=$("select#no10_c").val();
        var no11=$("select#no11_c").val();
        var total = Number(no1a) + Number(no1b) + Number(no1c) + Number(no2) +
                Number(no3) + Number(no4) + Number(no5a) + Number(no5b) +
                Number(no6a) + Number(no6b)+ Number(no7) + Number(no8) +
                Number(no9) + Number(no10) + Number(no11);
        $("div#nihss_a_score").html(total);
        
        
        //$("div#nihss_score").html(no1a);
    }

    function nihss_updatec(){
        fail = false;
        if($("#no1a_ra").is(":checked")){
            no1a_c = "<?php echo $nihss['no1a']?>";
        }
        else if($("#no1a_ri").is(":checked")){
            no1a_c = $("#no1a_c").val();
        }else{
            fail = true;
        }

        if($("#no1b_ra").is(":checked")){
            no1b_c = "<?php echo $nihss['no1b']?>";
        }
        else if($("#no1b_ri").is(":checked")){
            no1b_c = $("#no1b_c").val();
        }else{
            fail = true;
        }

        if($("#no1c_ra").is(":checked")){
            no1c_c = "<?php echo $nihss['no1c']?>";
        }
        else if($("#no1c_ri").is(":checked")){
            no1c_c = $("#no1c_c").val();
        }else{
            fail = true;
        }

        if($("#no2_ra").is(":checked")){
            no2_c = "<?php echo $nihss['no2']?>";
        }
        else if($("#no2_ri").is(":checked")){
            no2_c = $("#no2_c").val();
        }else{
            fail = true;
        }

        if($("#no3_ra").is(":checked")){
            no3_c = "<?php echo $nihss['no3']?>";
        }
        else if($("#no3_ri").is(":checked")){
            no3_c = $("#no3_c").val();
        }else{
            fail = true;
        }

        if($("#no4_ra").is(":checked")){
            no4_c = "<?php echo $nihss['no4']?>";
        }
        else if($("#no4_ri").is(":checked")){
            no4_c = $("#no4_c").val();
        }else{
            fail = true;
        }

        if($("#no5a_ra").is(":checked")){
            no5a_c = "<?php echo $nihss['no5a']?>";
        }
        else if($("#no5a_ri").is(":checked")){
            no5a_c = $("#no5a_c").val();
        }else{
            fail = true;
        }

        if($("#no5b_ra").is(":checked")){
            no5b_c = "<?php echo $nihss['no5b']?>";
        }
        else if($("#no5b_ri").is(":checked")){
            no5b_c = $("#no5b_c").val();
        }else{
            fail = true;
        }

        if($("#no6a_ra").is(":checked")){
            no6a_c = "<?php echo $nihss['no6a']?>";
        }
        else if($("#no6a_ri").is(":checked")){
            no6a_c = $("#no6a_c").val();
        }else{
            fail = true;
        }

        if($("#no6b_ra").is(":checked")){
            no6b_c = "<?php echo $nihss['no6b']?>";
        }
        else if($("#no6b_ri").is(":checked")){
            no6b_c = $("#no6b_c").val();
        }else{
            fail = true;
        }

        if($("#no7_ra").is(":checked")){
            no7_c = "<?php echo $nihss['no7']?>";
        }
        else if($("#no7_ri").is(":checked")){
            no7_c = $("#no7_c").val();
        }else{
            fail = true;
        }
        
        if($("#no8_ra").is(":checked")){
            no8_c = "<?php echo $nihss['no8']?>";
        }
        else if($("#no8_ri").is(":checked")){
            no8_c = $("#no8_c").val();
        }else{
            fail = true;
        }
        
        if($("#no9_ra").is(":checked")){
            no9_c = "<?php echo $nihss['no9']?>";
        }
        else if($("#no9_ri").is(":checked")){
            no9_c = $("#no9_c").val();
        }else{
            fail = true;
        }
        
        if($("#no10_ra").is(":checked")){
            no10_c = "<?php echo $nihss['no10']?>";
        }
        else if($("#no10_ri").is(":checked")){
            no10_c = $("#no10_c").val();
        }else{
            fail = true;
        }
        
        if($("#no11_ra").is(":checked")){
            no11_c = "<?php echo $nihss['no11']?>";
        }
        else if($("#no11_ri").is(":checked")){
            no11_c = $("#no11_c").val();
        }else{
            fail = true;
        }

        if(!fail){
            $.ajax({
            type: "POST",
            url: "../ajax/saveNIHSSCData/",
            data: {
                p_id:$("input#p_id").val(),
                c_id:$("input#c_id").val(),
                no1a:no1a_c,
                no1b:no1b_c,
                no1c:no1c_c,
                no2:no2_c,
                no3:no3_c,
                no4:no4_c,
                no5a:no5a_c,
                no5b:no5b_c,
                no6a:no6a_c,
                no6b:no6b_c,
                no7:no7_c,
                no8:no8_c,
                no9:no9_c,
                no10:no10_c,
                no11:no11_c
            },
            dataType: "html",
            success: function(data) {
               alert("Saved");
            }
        });
        }else{
            alert("คุณยัง Verify ไม่ครบ");
        }
    }

    function estimate_function(id,value){
       if($("#"+id+"_ri").is(":checked")){
            return !$("#"+id).is(":checked");
       }else{
           return value;
       }
    }

    function estimate_isCheck(n){
        if($("#"+n+"_ra").is(":checked") || $("#"+n+"_ri").is(":checked")){
            return false;
        }else{
            return true;
        }
    }

    function estimate_updatec(){
        
        var fail = true;

        var estimate_i1 = "<?php echo $est['estimate_i1']?>";
        var estimate_i2 = "<?php echo $est['estimate_i2']?>";
        var estimate_i3 = "<?php echo $est['estimate_i3']?>";
        var estimate_d1 = "<?php echo $est['estimate_d1']?>";
        var estimate_d2 = "<?php echo $est['estimate_d2']?>";
        var estimate_d3 = "<?php echo $est['estimate_d3']?>";
        var estimate_d4 = "<?php echo $est['estimate_d4']?>";
        var estimate_d5 = "<?php echo $est['estimate_d5']?>";
        var estimate_d6 = "<?php echo $est['estimate_d6']?>";
        var estimate_d7 = "<?php echo $est['estimate_d7']?>";
        var estimate_d8 = "<?php echo $est['estimate_d8']?>";
        var estimate_d9 = "<?php echo $est['estimate_d9']?>";
        var estimate_d10 = "<?php echo $est['estimate_d10']?>";
        var estimate_d11 = "<?php echo $est['estimate_d11']?>";
        var estimate_d12 = "<?php echo $est['estimate_d12']?>";
        var estimate_reason = "<?php echo $est['estimate_reason']?>";

        estimate_i1 = estimate_function('estimate_i1',estimate_i1);        
        estimate_i2 = estimate_function('estimate_i2',estimate_i2);
        estimate_i3 = estimate_function('estimate_i3',estimate_i3);
        estimate_d1 = estimate_function('estimate_d1',estimate_d1);
        estimate_d2 = estimate_function('estimate_d2',estimate_d2);
        estimate_d3 = estimate_function('estimate_d3',estimate_d3);
        estimate_d4 = estimate_function('estimate_d4',estimate_d4);
        estimate_d5 = estimate_function('estimate_d5',estimate_d5);
        estimate_d6 = estimate_function('estimate_d6',estimate_d6);
        estimate_d7 = estimate_function('estimate_d7',estimate_d7);
        estimate_d8 = estimate_function('estimate_d8',estimate_d8);
        estimate_d9 = estimate_function('estimate_d9',estimate_d9);
        estimate_d10 = estimate_function('estimate_d10',estimate_d10);
        estimate_d11 = estimate_function('estimate_d11',estimate_d11);
        estimate_d12 = estimate_function('estimate_d12',estimate_d12);
        
        fail = estimate_isCheck('estimate_i1') 
            || estimate_isCheck('estimate_i2')
            || estimate_isCheck('estimate_i3')
            || estimate_isCheck('estimate_d1')
            ||  estimate_isCheck('estimate_d2')
            ||  estimate_isCheck('estimate_d3')
            ||  estimate_isCheck('estimate_d4')
            ||  estimate_isCheck('estimate_d5')
            ||  estimate_isCheck('estimate_d6')
            ||  estimate_isCheck('estimate_d7')
            ||  estimate_isCheck('estimate_d8')
            ||  estimate_isCheck('estimate_d9')
            ||  estimate_isCheck('estimate_d10')
            ||  estimate_isCheck('estimate_d11')
            ||  estimate_isCheck('estimate_d12');
                       
        if(!fail){
            $.ajax({
            type: "POST",
            url: "../ajax/saveEstimateCData/",
            data: {
                p_id:$("input#p_id").val(),
                c_id:$("input#c_id").val(),
                estimate_i1:estimate_i1,
                estimate_i2:estimate_i2,
                estimate_i3:estimate_i3,
                estimate_d1:estimate_d1,
                estimate_d2:estimate_d2,
                estimate_d3:estimate_d3,
                estimate_d4:estimate_d4,
                estimate_d5:estimate_d5,
                estimate_d6:estimate_d6,
                estimate_d7:estimate_d7,
                estimate_d8:estimate_d8,
                estimate_d9:estimate_d9,
                estimate_d10:estimate_d10,
                estimate_d11:estimate_d11,
                estimate_d12:estimate_d12,
                estimate_reason:estimate_reason
            },
            dataType: "html",
            success: function(data) {
               alert("Saved");
            }
        });
        }else{
            alert("คุณยัง Verify ไม่ครบ");
        }
    }

    function sm_save(){
        $('#smBtn').attr('value',"Saving");
        $.ajax({
            type: "POST",
            url: "../ajax/updateSuggestManagement/",
            data: {
                p_id:$("input#p_id").val(),
                c_id:$("input#c_id").val(),
                sm_IVTYn:$("#sm_IVTYn").is(':checked'),
                sm_IVTStartTime:$("#sm_IVTStartTime").val(),
                sm_NIVTYn:$("#sm_NIVTYn").is(':checked'),
                sm_NIVTC:$("#sm_NIVTC").val(),
                sm_OtherYN:$("#sm_OtherYN").is(':checked'),
                sm_OtherTxt:$("#sm_OtherTxt").val()
            },
            dataType: "html",
            success: function(data) {
               $('#smBtn').attr('value',"Save");
            }
        });
    }
</script>
<style>
    .d{
        color:blue;
        width: 60px;        
    }
    .d1{
        color:blue;
        width: 120px;        
    }
    .d2{
        color:blue;
        
    };
</style>

    <!--<form id="frmConsultData" method="post" action="<?php echo url::base();?>patient/consult/" >-->
    <form id="frmConsultData" action="">
        <input type="hidden" id="c_id" name="c_id" value="<?php echo $c_id ?>">
        <input type="hidden" id="p_id" name="p_id" value="<?php echo $p_id ?>">
        <input type="hidden" id="method" name="method" value="save">
        <table align="right">
            <tr>               
                <td width="40" align="center" style="border-bottom: 1px dashed black" width="90%"><div style="color: red;" id="strokeLeftHour">00</div></td><td>ชั่วโมง</td>
                <td width="40" align="center" style="border-bottom: 1px dashed black" width="90%"> <div style="color: red;" id="strokeLeftMinute">00</div></td><td>นาที</td>
                <td width="40" align="center" style="border-bottom: 1px dashed black" width="90%"> <div style="color: red;" id="strokeLeftSecond">00</div></td><td>วินาที</td>
            </tr>
        </table>
        <table width="100%" class="ui-widget ui-widget-content">
            <tr>               
                <td align="left" valign="top" style="padding: 10px">                
                    <div id="tabs">
                        <ul>
                            <li><a href="#tabs-1" style="font-size: 11px">NIHSS</a></li>
                            <li><a href="#tabs-2" style="font-size: 11px">Stroke Data</a></li>
                            <li><a href="#tabs-3" style="font-size: 11px">Stroke Physical</a></li>
                            <li><a href="#tabs-4" style="font-size: 11px">Laboratory screen</a></li>
                            <li><a href="#tabs-5" style="font-size: 11px">ประเมินทางประสาทวิทยา</a></li>
                            <li><a href="#tabs-6" style="font-size: 11px">Management</a></li>
                            <li><a href="#tabs-7" style="font-size: 11px">ข้อมูลคนไข้</a></li>
                        </ul>

                        <div id="tabs-1">
                            <table class="ui-widget ui-widget-content ui-corner-all" cellspacing="0">
                                <tr id="no1a_tro">
                                    <td width="95">
                                        <div id="no1a_r">
                                            <input type="radio" id="no1a_ra" name="no1a_r" onchange="verify('no1a')"/><label for="no1a_ra">A</label>
                                            <input type="radio" id="no1a_ri" name="no1a_r" onchange="verify('no1a')"/><label for="no1a_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 1a. Level of consciousness </td>
                                    <td style="padding-left: 5px">
                                        <div id="no1a">
                                            <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 0? "Alert (0)": "") : "" ?>
                                            <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 1? "Drowsy (1)": "") : "" ?>
                                            <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 2? "Stuporous (2)": "") : "" ?>
                                            <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 3? "Coma (3)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no1a_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no1a_c" id="no1a_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 0? "selected": "") : "" ?>>Alert (0)</option>
                                            <option value="1" <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 1? "selected": "") : "" ?>>Drowsy (1)</option>
                                            <option value="2" <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 2? "selected": "") : "" ?>>Stuporous (2)</option>
                                            <option value="3" <?php echo isset($nihss['no1a'])? ($nihss['no1a'] == 3? "selected": "") : "" ?>>Coma (3)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no1b_tro">
                                    <td>
                                        <div id="no1b_r">
                                            <input type="radio" id="no1b_ra" name="no1b_r" onchange="verify('no1b')"/><label for="no1b_ra">A</label>
                                            <input type="radio" id="no1b_ri" name="no1b_r" onchange="verify('no1b')"/><label for="no1b_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 1b. Two questions ถามอายุและเดือน </td>
                                    <td style="padding-left: 5px">
                                        <div id="no1b">
                                            <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 0? "Both correct (0)": "") : "" ?>
                                            <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 1? "One correct (1)": "") : "" ?>
                                            <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 2? "None correct (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no1b_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no1b_c" id="no1b_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 0? "selected": "") : "" ?>>Both correct (0)</option>
                                            <option value="1" <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 1? "selected": "") : "" ?>>One correct (1)</option>
                                            <option value="2" <?php echo isset($nihss['no1b'])? ($nihss['no1b'] == 2? "selected": "") : "" ?>>None correct (2)</option>
                                        </select></td>
                                </tr>
                                <tr id="no1c_tro">
                                    <td>
                                        <div id="no1c_r">
                                            <input type="radio" id="no1c_ra" name="no1c_r" onchange="verify('no1c')"/><label for="no1c_ra">A</label>
                                            <input type="radio" id="no1c_ri" name="no1c_r" onchange="verify('no1c')"/><label for="no1c_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 1c. Two commands หลับตา ลืมตาและกำมือ แบมือ  </td>
                                    <td style="padding-left: 5px">
                                        <div id="no1c">
                                            <?php echo isset($nihss['no1c'])? ($nihss['no1c'] == 0? "Obeys both (0)": "") : "" ?>
                                            <?php echo isset($nihss['no1c'])? ($nihss['no1c'] == 1? "Obeys none (1)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no1c_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no1c_c" id="no1c_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no1c'])? ($nihss['no1c'] == 0? "selected": "") : "" ?>>Obeys both (0)</option>
                                            <option value="1" <?php echo isset($nihss['no1c'])? ($nihss['no1c'] == 1? "selected": "") : "" ?>>Obeys none (1)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no2_tro">
                                    <td>
                                        <div id="no2_r">
                                            <input type="radio" id="no2_ra" name="no2_r" onchange="verify('no2')"/><label for="no2_ra">A</label>
                                            <input type="radio" id="no2_ri" name="no2_r" onchange="verify('no2')"/><label for="no2_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 2. Best gaze มองด้านข้าง  </td>
                                    <td style="padding-left: 5px">
                                        <div id="no2">
                                            <?php echo isset($nihss['no2'])? ($nihss['no2'] == 0? "Normal (0)": "") : "" ?>
                                            <?php echo isset($nihss['no2'])? ($nihss['no2'] == 1? "Partial gaze palsy (1)": "") : "" ?>
                                            <?php echo isset($nihss['no2'])? ($nihss['no2'] == 2? "Forced deviation (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no2_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no2_c" id="no2_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no2'])? ($nihss['no2'] == 0? "selected": "") : "" ?>>Normal (0)</option>
                                        <option value="1" <?php echo isset($nihss['no2'])? ($nihss['no2'] == 1? "selected": "") : "" ?>>Partial gaze palsy (1)</option>
                                        <option value="2" <?php echo isset($nihss['no2'])? ($nihss['no2'] == 2? "selected": "") : "" ?>>Forced deviation (2)</option>
                                        </select></td>
                                </tr>
                                <tr id="no3_tro">
                                    <td>
                                        <div id="no3_r">
                                            <input type="radio" id="no3_ra" name="no3_r" onchange="verify('no3')"/><label for="no3_ra">A</label>
                                            <input type="radio" id="no3_ri" name="no3_r" onchange="verify('no3')"/><label for="no3_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 3. Best visual (visual field)</td>
                                    <td style="padding-left: 5px">
                                        <div id="no3">
                                            <?php echo isset($nihss['no3'])? ($nihss['no3'] == 0? "No visual loss (0)": "") : "" ?>
                                            <?php echo isset($nihss['no3'])? ($nihss['no3'] == 1? "Partial hemianopia (1)": "") : "" ?>
                                            <?php echo isset($nihss['no3'])? ($nihss['no3'] == 2? "Complete  hemianopia (2)": "") : "" ?>
                                            <?php echo isset($nihss['no3'])? ($nihss['no3'] == 3? "Bilateral hemianopia (3)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no3_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no3_c" id="no3_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no3'])? ($nihss['no3'] == 0? "selected": "") : "" ?>>No visual loss (0)</option>
                                            <option value="1" <?php echo isset($nihss['no3'])? ($nihss['no3'] == 1? "selected": "") : "" ?>>Partial hemianopia (1)</option>
                                            <option value="2" <?php echo isset($nihss['no3'])? ($nihss['no3'] == 2? "selected": "") : "" ?>>Complete  hemianopia (2)</option>
                                            <option value="3" <?php echo isset($nihss['no3'])? ($nihss['no3'] == 3? "selected": "") : "" ?>>Bilateral hemianopia (3)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no4_tro">
                                    <td>
                                        <div id="no4_r">
                                            <input type="radio" id="no4_ra" name="no4_r" onchange="verify('no4')"/><label for="no4_ra">A</label>
                                            <input type="radio" id="no4_ri" name="no4_r" onchange="verify('no4')"/><label for="no4_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 4. Facial palsy</td>
                                    <td style="padding-left: 5px">
                                        <div id="no4">
                                            <?php echo isset($nihss['no4'])? ($nihss['no4'] == 0? "Normal (0)": "") : "" ?>
                                            <?php echo isset($nihss['no4'])? ($nihss['no4'] == 1? "Minor (1)": "") : "" ?>
                                            <?php echo isset($nihss['no4'])? ($nihss['no4'] == 2? "Partial (2)": "") : "" ?>
                                            <?php echo isset($nihss['no4'])? ($nihss['no4'] == 3? "Complete (3)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no4_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no4_c" id="no4_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no4'])? ($nihss['no4'] == 0? "selected": "") : "" ?>>Normal (0)</option>
                                        <option value="1" <?php echo isset($nihss['no4'])? ($nihss['no4'] == 1? "selected": "") : "" ?>>Minor (1)</option>
                                        <option value="2" <?php echo isset($nihss['no4'])? ($nihss['no4'] == 2? "selected": "") : "" ?>>Partial (2)</option>
                                        <option value="3" <?php echo isset($nihss['no4'])? ($nihss['no4'] == 3? "selected": "") : "" ?>>Complete (3)</option>
                                        </select></td>
                                </tr>
                                <tr id="no5a_tro">
                                    <td>
                                        <div id="no5a_r">
                                            <input type="radio" id="no5a_ra" name="no5a_r" onchange="verify('no5a')"/><label for="no5a_ra">A</label>
                                            <input type="radio" id="no5a_ri" name="no5a_r" onchange="verify('no5a')"/><label for="no5a_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 5a. Best Motor Lt arms นั่งยกแขน 90 องศา 10 วินาทีหรือนอนยกแขน 45 องศา</td>
                                    <td style="padding-left: 5px">
                                        <div id="no5a">
                                            <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 0? "No drift (0)": "") : "" ?>
                                            <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 1? "Drift (1)": "") : "" ?>
                                            <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 2? "Fall in 10 secs (2)": "") : "" ?>
                                            <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 3? "No effort against gravity (3)": "") : "" ?>
                                            <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 4? "No movement (4)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no5a_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no5a_c" id="no5a_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 0? "selected": "") : "" ?>>No drift (0)</option>
                                            <option value="1" <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 1? "selected": "") : "" ?>>Drift (1)</option>
                                            <option value="2" <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 2? "selected": "") : "" ?>>Fall in 10 secs (2)</option>
                                            <option value="3" <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 3? "selected": "") : "" ?>>No effort against gravity (3)</option>
                                            <option value="4" <?php echo isset($nihss['no5a'])? ($nihss['no5a'] == 4? "selected": "") : "" ?>>No movement (4)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no5b_tro">
                                    <td>
                                        <div id="no5b_r">
                                            <input type="radio" id="no5b_ra" name="no5b_r" onchange="verify('no5b')"/><label for="no5b_ra">A</label>
                                            <input type="radio" id="no5b_ri" name="no5b_r" onchange="verify('no5b')"/><label for="no5b_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 5b. Best Motor Rt arms นั่งยกแขน 90 องศา 10 วินาทีหรือนอนยกแขน 45 องศา</td>
                                    <td style="padding-left: 5px">
                                        <div id="no5b">
                                            <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 0? "No drift (0)": "") : "" ?>
                                            <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 1? "Drift (1)": "") : "" ?>
                                            <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 2? "Fall in 10 secs (2)": "") : "" ?>
                                            <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 3? "No effort against gravity (3)": "") : "" ?>
                                            <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 4? "No movement (4)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no5b_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no5b_c" id="no5b_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 0? "selected": "") : "" ?>>No drift (0)</option>
                                        <option value="1" <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 1? "selected": "") : "" ?>>Drift (1)</option>
                                        <option value="2" <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 2? "selected": "") : "" ?>>Fall in 10 secs (2)</option>
                                        <option value="3" <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 3? "selected": "") : "" ?>>No effort against gravity (3)</option>
                                        <option value="4" <?php echo isset($nihss['no5b'])? ($nihss['no5b'] == 4? "selected": "") : "" ?>>No movement (4)</option>
                                        </select></td>
                                </tr>
                                <tr id="no6a_tro">
                                    <td>
                                        <div id="no6a_r">
                                            <input type="radio" id="no6a_ra" name="no6a_r" onchange="verify('no6a')"/><label for="no6a_ra">A</label>
                                            <input type="radio" id="no6a_ri" name="no6a_r" onchange="verify('no6a')"/><label for="no6a_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 6a. Best Motor Lt legs นอนยกขา 30 องศา 5 วินาที </td>
                                    <td style="padding-left: 5px">
                                        <div id="no6a">
                                            <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 0? "No drift (0)": "") : "" ?>
                                            <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 1? "Drift (1)": "") : "" ?>
                                            <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 2? "Fall in 10 secs (2)": "") : "" ?>
                                            <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 3? "No effort against gravity (3)": "") : "" ?>
                                            <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 4? "No movement (4)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no6a_tr"><td></td><td align="right">Change To</td><td>
                                        <select name="no6a_c" id="no6a_c" onchange="onchange_nihss()">
                                           <option value="0" <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 0? "selected": "") : "" ?>>No drift (0)</option>
                                            <option value="1" <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 1? "selected": "") : "" ?>>Drift (1)</option>
                                            <option value="2" <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 2? "selected": "") : "" ?>>Fall in 10 secs (2)</option>
                                            <option value="3" <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 3? "selected": "") : "" ?>>No effort against gravity (3)</option>
                                            <option value="4" <?php echo isset($nihss['no6a'])? ($nihss['no6a'] == 4? "selected": "") : "" ?>>No movement (4)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no6b_tro">
                                    <td>
                                        <div id="no6b_r">
                                            <input type="radio" id="no6b_ra" name="no6b_r" onchange="verify('no6b')"/><label for="no6b_ra">A</label>
                                            <input type="radio" id="no6b_ri" name="no6b_r" onchange="verify('no6b')"/><label for="no6b_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 6b. Best Motor Rt legs นอนยกขา 30 องศา 5 วินาที </td>
                                    <td style="padding-left: 5px">
                                        <div id="no6b">
                                            <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 0? "No drift (0)": "") : "" ?>
                                            <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 1? "Drift (1)": "") : "" ?>
                                            <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 2? "Fall in 10 secs (2)": "") : "" ?>
                                            <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 3? "No effort against gravity (3)": "") : "" ?>
                                            <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 4? "No movement (4)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no6b_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no6b_c" id="no6b_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 0? "selected": "") : "" ?>>No drift (0)</option>
                                            <option value="1" <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 1? "selected": "") : "" ?>>Drift (1)</option>
                                            <option value="2" <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 2? "selected": "") : "" ?>>Fall in 10 secs (2)</option>
                                            <option value="3" <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 3? "selected": "") : "" ?>>No effort against gravity (3)</option>
                                            <option value="4" <?php echo isset($nihss['no6b'])? ($nihss['no6b'] == 4? "selected": "") : "" ?>>No movement (4)</option>
                                        </select></td>
                                </tr>
                                <tr id="no7_tro">
                                    <td>
                                        <div id="no7_r">
                                            <input type="radio" id="no7_ra" name="no7_r" onchange="verify('no7')"/><label for="no7_ra">A</label>
                                            <input type="radio" id="no7_ri" name="no7_r" onchange="verify('no7')"/><label for="no7_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 7. Limb Ataxia </td>
                                    <td style="padding-left: 5px">
                                        <div id="no7">
                                            <?php echo isset($nihss['no7'])? ($nihss['no7'] == 0? "Absent (0)": "") : "" ?>
                                            <?php echo isset($nihss['no7'])? ($nihss['no7'] == 1? "Upper or lower limb (1)": "") : "" ?>
                                            <?php echo isset($nihss['no7'])? ($nihss['no7'] == 2? "Upper & lower limb (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no7_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no7_c" id="no7_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no7'])? ($nihss['no7'] == 0? "selected": "") : "" ?>>Absent (0)</option>
                                            <option value="1" <?php echo isset($nihss['no7'])? ($nihss['no7'] == 1? "selected": "") : "" ?>>Upper or lower limb (1)</option>
                                            <option value="2" <?php echo isset($nihss['no7'])? ($nihss['no7'] == 2? "selected": "") : "" ?>>Upper & lower limb (2)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no8_tro">
                                    <td>
                                        <div id="no8_r">
                                            <input type="radio" id="no8_ra" name="no8_r" onchange="verify('no8')"/><label for="no8_ra">A</label>
                                            <input type="radio" id="no8_ri" name="no8_r" onchange="verify('no8')"/><label for="no8_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 8. Sensory </td>
                                    <td style="padding-left: 5px">
                                        <div id="no8">
                                             <?php echo isset($nihss['no8'])? ($nihss['no8'] == 0? "Normal (0)": "") : "" ?>
                                             <?php echo isset($nihss['no8'])? ($nihss['no8'] == 1? "Partial loss (1)": "") : "" ?>
                                             <?php echo isset($nihss['no8'])? ($nihss['no8'] == 2? "Dense loss (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no8_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no8_c" id="no8_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no8'])? ($nihss['no8'] == 0? "selected": "") : "" ?>>Normal (0)</option>
                                            <option value="1" <?php echo isset($nihss['no8'])? ($nihss['no8'] == 1? "selected": "") : "" ?>>Partial loss (1)</option>
                                            <option value="2" <?php echo isset($nihss['no8'])? ($nihss['no8'] == 2? "selected": "") : "" ?>>Dense loss (2)</option>
                                        </select></td>
                                </tr>
                                <tr id="no9_tro">
                                    <td>
                                        <div id="no9_r">
                                            <input type="radio" id="no9_ra" name="no9_r" onchange="verify('no9')"/><label for="no9_ra">A</label>
                                            <input type="radio" id="no9_ri" name="no9_r" onchange="verify('no9')"/><label for="no9_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 9. Best language Aphasia </td>
                                    <td style="padding-left: 5px">
                                        <div id="no9">
                                            <?php echo isset($nihss['no9'])? ($nihss['no9'] == 0? "No aphasia (0)": "") : "" ?>
                                            <?php echo isset($nihss['no9'])? ($nihss['no9'] == 1? "Mild to moderate (1)": "") : "" ?>
                                            <?php echo isset($nihss['no9'])? ($nihss['no9'] == 2? "Severe (2)": "") : "" ?>
                                            <?php echo isset($nihss['no9'])? ($nihss['no9'] == 3? "Mute (3)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no9_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no9_c" id="no9_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no9'])? ($nihss['no9'] == 0? "selected": "") : "" ?>>No aphasia (0)</option>
                                        <option value="1" <?php echo isset($nihss['no9'])? ($nihss['no9'] == 1? "selected": "") : "" ?>>Mild to moderate (1)</option>
                                        <option value="2" <?php echo isset($nihss['no9'])? ($nihss['no9'] == 2? "selected": "") : "" ?>>Severe (2)</option>
                                        <option value="3" <?php echo isset($nihss['no9'])? ($nihss['no9'] == 3? "selected": "") : "" ?>>Mute (3)</option>
                                        </select></td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="no10_tro">
                                    <td>
                                        <div id="no10_r">
                                            <input type="radio" id="no10_ra" name="no10_r" onchange="verify('no10')"/><label for="no10_ra">A</label>
                                            <input type="radio" id="no10_ri" name="no10_r" onchange="verify('no10')"/><label for="no10_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 10. Dysarthria </td>
                                    <td style="padding-left: 5px">
                                        <div id="no10">
                                            <?php echo isset($nihss['no10'])? ($nihss['no10'] == 0? "Normal articulation (0)": "") : "" ?>
                                            <?php echo isset($nihss['no10'])? ($nihss['no10'] == 1? "Mild to moderate (1)": "") : "" ?>
                                            <?php echo isset($nihss['no10'])? ($nihss['no10'] == 2? "Severe (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no10_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no10_c" id="no10_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no10'])? ($nihss['no10'] == 0? "selected": "") : "" ?>>Normal articulation (0)</option>
                                            <option value="1" <?php echo isset($nihss['no10'])? ($nihss['no10'] == 1? "selected": "") : "" ?>>Mild to moderate (1)</option>
                                            <option value="2" <?php echo isset($nihss['no10'])? ($nihss['no10'] == 2? "selected": "") : "" ?>>Severe (2)</option>
                                        </select></td>
                                </tr>
                                <tr id="no11_tro">
                                    <td>
                                        <div id="no11_r">
                                            <input type="radio" id="no11_ra" name="no11_r" onchange="verify('no11')"/><label for="no11_ra">A</label>
                                            <input type="radio" id="no11_ri" name="no11_r" onchange="verify('no11')"/><label for="no11_ri">I</label>
                                        </div>
                                    </td>
                                    <td valign="top"> 11. Neglect </td>
                                    <td style="padding-left: 5px">
                                        <div id="no11">
                                            <?php echo isset($nihss['no11'])? ($nihss['no11'] == 0? "No neglect (0)": "") : "" ?>
                                            <?php echo isset($nihss['no11'])? ($nihss['no11'] == 1? "Sensory or visual (1)": "") : "" ?>
                                            <?php echo isset($nihss['no11'])? ($nihss['no11'] == 2? "Sensory & visual (2)": "") : "" ?>
                                        </div>
                                    </td>
                                </tr>
                                <tr style="display: none" id="no11_tr">
                                    <td></td><td>Change To</td><td>
                                        <select name="no11_c" id="no11_c" onchange="onchange_nihss()">
                                            <option value="0" <?php echo isset($nihss['no11'])? ($nihss['no11'] == 0? "selected": "") : "" ?>>No neglect (0)</option>
                                            <option value="1" <?php echo isset($nihss['no11'])? ($nihss['no11'] == 1? "selected": "") : "" ?>>Sensory or visual (1)</option>
                                            <option value="2" <?php echo isset($nihss['no11'])? ($nihss['no11'] == 2? "selected": "") : "" ?>>Sensory & visual (2)</option>
                                        </select></td>
                                </tr>
                                <tr>
                                    <td><input type="button" id="nihss_confirm" onclick="nihss_updatec()" value="Confirm"></td>
                                    <td align="right">Total Score</td>
                                    <td> <div id="nihss_score"></div></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td align="right">Approve Score</td>
                                    <td> <div id="nihss_a_score" style="color:blue;font-weight: bold">-</div></td>
                                </tr>
                            </table>
                        </div>

                        <div id="tabs-2">
                            <table id="users" class="ui-widget ui-widget-content ui-corner-all" width="100%" style="margin-top: 10px;padding-bottom: 10px;">
                            <thead>
                                <tr class="ui-widget-header ">
                                    <th colspan="7" align="left" style="padding: 10px">Stroke Data</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="2">
                                        <table width="100%"><tr>
                                                <td>วันที่ </td><td align="left"><u style="color: blue"><?php
                                                echo date("Y-m-d");
                                                ?></u></td><td align="left">ชื่อ </td><td><u style="color: blue"><?php echo $patient['p_fname']." ".$patient['p_lname']  ?></u></td><td></td><td></td>
                                            </tr></table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td>อายุ </td><td style="border-bottom: 1px dashed black"><font color="blue"> <?php echo date("Y")-strftime("%Y",strtotime($patient['p_bday']));?> </font></td><td>ปี</td>
                                                <td>วันเดือนปีเกิด : </td><td style="border-bottom: 1px dashed black"><font color="blue">  <?php echo $patient['p_bday'];?></font></td><td></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td rowspan="2" width="150">เวลาที่เกิดอาการ </td>
                                                <td style="border-bottom: 1px dashed black">
                                                   <div id="strokeTime" class="d2">
                                                    <?php   if(isset($std['strokeTimeYN']) && $std['strokeTimeYN']=="yes") {
                                                                  echo "ทราบ ";
                                                                  echo isset($std['strokeTimeHour'])? " เวลา ".$std['strokeTimeHour'] :"00";
                                                                  echo isset($std['strokeTimeMinute'])? " : ".$std['strokeTimeMinute'] :"00";
                                                                  echo " วันที่: " .$std['strokeTimeDMY'];
                                                             }else if(isset($std['strokeTimeYN']) && $std['strokeTimeYN']=="no") {
                                                                 echo "ไม่ทราบ ";
                                                             }
                                                   ?>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td rowspan="2" width="150">เวลาสุดท้ายที่ปกติ </td>
                                                <td  style="border-bottom: 1px dashed black"><div id="strokeNormalTime" class="d2">
                                                    <?php   if(isset($std['strokeNormalTimeYN']) && $std['strokeNormalTimeYN']=="yes") {
                                                                  echo "ทราบ ";
                                                                  echo isset($std['strokeNormalTimeHour'])? "เวลา ".$std['strokeNormalTimeHour'] :"00";
                                                                  echo isset($std['strokeNormalTimeMinute'])? " : ".$std['strokeNormalTimeMinute'] :"00";
                                                                  echo " วันที่: ".$std['strokeNormalTimeDMY'];
                                                             }else if(isset($std['strokeNormalTimeYN']) && $std['strokeNormalTimeYN']=="no") {
                                                                 echo "ไม่ทราบ ";
                                                             }
                                                   ?>
                                                    </div>
                                                </td>
                                            </tr>                                            
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td width="120">เหลือเวลาอีก</td>
                                                <td width="40" align="center" style="border-bottom: 1px dashed black" width="90%"><div style="color: red;" id="strokeLeftHour"></div> </td><td>ชั่วโมง</td>
                                                <td width="40" align="center" style="border-bottom: 1px dashed black" width="90%"> <div style="color: red;" id="strokeLeftMinute"></div></td><td>นาที</td>
                                            </tr>                                            
                                        </table>
                                </tr>
                                <tr>
                                    <td>
                                        CC:
                                    </td>
                                    <td style="border-bottom: 1px dashed black" width="90%"><div style="color:blue" id="cc"><?php echo isset($std['cc'])? $std['cc']:"" ?></div></td>
                                </tr>
                                <tr>
                                    <td>
                                        PI:
                                    </td>
                                    <td style="border-bottom: 1px dashed black" width="90%">
                                        <div style="color:blue" id="PI"><?php echo isset($std['PI'])?$std['PI']:"" ?></div>
                                    </td>
                                </tr>                                
                                <tr>
                                    <td valign="top">
                                        PH:
                                    </td>
                                    <td>
                                        <table width="100%" style="border: solid 1px gray">
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_ht_yn" name="ph_ht_yn" disabled <?php echo isset($std['ph_ht_yn'])? ($std['ph_ht_yn'] == "true"? "checked": "") : "" ?>>HT
                                                            </td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_ht_yrs" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_ht_yrs'])?$std['ph_ht_yrs']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                            <td>Med</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_ht_med" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_ht_med'])?$std['ph_ht_med']:"" ?></div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_dm_yn" name="ph_dm_yn" disabled <?php echo isset($std['ph_dm_yn'])? ($std['ph_dm_yn'] == "true"? "checked": "") : "" ?>>DM
                                                            </td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_dm_yrs" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_dm_yrs'])?$std['ph_dm_yrs']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                            <td>Med</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_dm_med" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_dm_med'])?$std['ph_dm_med']:"" ?></div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_dyslipidemia_yn"  name="ph_dyslipidemia_yn" disabled <?php echo isset($std['ph_dyslipidemia_yn'])? ($std['ph_dyslipidemia_yn'] == "true"? "checked": "") : "" ?>>Dyslipidemia
                                                            </td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_dyslipidemia_yrs" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_dyslipidemia_yrs'])?$std['ph_dyslipidemia_yrs']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                            <td>Med</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_dyslipidemia_med" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_dyslipidemia_med'])?$std['ph_dyslipidemia_med']:"" ?></div></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td><input type="checkbox" id="ph_smoking_yn" name="ph_smoking_yn" disabled <?php echo isset($std['ph_smoking_yn'])? ($std['ph_smoking_yn'] == "true"? "checked": "") : "" ?>>Smoking</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_smoking_pack" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_smoking_pack'])?$std['ph_smoking_pack']:"" ?></div>
                                                            </td>
                                                            <td>Packs/day</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_smoking_yrs" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_smoking_yrs'])?$std['ph_smoking_yrs']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                            <td>Quit</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_smoking_qyrs" style="color:blue;width: 80px" align="center"><?php echo isset($std['ph_smoking_qyrs'])?$std['ph_smoking_qyrs']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_heart_disease_yn" name="ph_heart_disease_yn" disabled <?php echo isset($std['ph_heart_disease_yn'])? ($std['ph_heart_disease_yn'] == "true"? "checked": "") : "" ?>>Heart disease type</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_heart_disease_type" style="color:blue;width: 80px" align="left"><?php echo isset($std['ph_heart_disease_type'])?$std['ph_heart_disease_type']:"" ?></div>
                                                            </td>
                                                            <td>Med</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_heart_disease_med" style="color:blue;width: 80px" align="left"><?php echo isset($std['ph_heart_disease_med'])?$std['ph_heart_disease_med']:"" ?></div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_stroke_yn" name="ph_stroke_yn" disabled <?php echo isset($std['ph_stroke_yn'])? ($std['ph_stroke_yn'] == "true"? "checked": "") : "" ?>>Stroke</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_stroke_year" style="color:blue;width: 100px" align="center"><?php echo isset($std['ph_stroke_year'])?$std['ph_stroke_year']:"" ?></div>
                                                            </td>
                                                            <td>Yrs.</td>
                                                            <td>Type</td>
                                                            <td style="border-bottom: 1px dashed black">
                                                                <div id="ph_stroke_type" style="color:blue;width: 100%" align="left">
                                                                <?php
                                                                        echo isset($std['ph_stroke_type'])? ($std['ph_stroke_type'] == "i"? "ischemic": "") : "";
                                                                        echo isset($std['ph_stroke_type'])? ($std['ph_stroke_type'] == "ich"? "ICH": "") : "";
                                                                        echo isset($std['ph_stroke_type'])? ($std['ph_stroke_type'] == "sah"? "SAH": "") : "" ?>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <input type="checkbox" id="ph_others_yn" name="ph_others_yn" disabled <?php echo isset($std['ph_others_yn'])? ($std['ph_others_yn'] == "true"? "checked": "") : "" ?>>Others</td>
                                                            <td style="border: 1px dashed black" width="400">
                                                                <div id="ph_others" style="color:blue;width: 100%" align="left"><?php echo isset($std['ph_others'])?$std['ph_others']:"" ?></div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr><td colspan="4" align="center"></td></tr>
                            </tbody>
                        </table>
                        </div>

                        <div id="tabs-3">
                            <table id="users" class="ui-widget ui-widget-content ui-corner-all" width="102%" style="margin-top: 5px;padding-bottom: 10px;">
                            <thead>
                                <tr class="ui-widget-header ">
                                    <th colspan="7" align="left" style="padding: 10px">Stroke Physical examination</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td colspan="2">
                                        <table>
                                            <tr>
                                                <td width="10"><b><u>BP</u></b>:</td>
                                                <td width="10" style="border-bottom: 1px dashed black">
                                                    <div id="BPmax" class="d" align="right"><?php echo isset($stp['BPmax'])?$stp['BPmax']:"-" ?></div></td>
                                                <td>/</td>
                                                <td width="10" style="border-bottom: 1px dashed black"><div class="d"  id="BPmin"><?php echo isset($stp['BPmin'])?$stp['BPmin']:"-" ?></div></td>
                                                <td>,</td>
                                                <td width="10"><b><u>PR:</u></b></td>
                                                <td style="border-bottom: 1px dashed black"><div id="PR" class="d" align="right"><?php echo isset($stp['PR'])?$stp['PR']:"-" ?></div></td>
                                                <td>/</td>
                                                <td>min regular</td>
                                                <td style="border-bottom: 1px dashed black" align="center">
                                                    <div id="PRminYN" class="d">
                                                            <?php echo isset($stp['PRminYN'])? ($stp['PRminYN'] == "y"? "<font color=blue>Yes</font>": "") : "" ?>
                                                            <?php echo isset($stp['PRminYN'])? ($stp['PRminYN'] == "n"? "<font color=red>No</font>": "") : "" ?>
                                                    </div>
                                                </td></tr>
                                        </table>
                                        <table>
                                            <tr><td style="padding-left: 5px"><b><u>Carotid bruit</u></b></td>
                                                <td>Lt: </td>
                                                <td style="border-bottom: 1px dashed black"><div id="CarotidLt" class="d">
                                                            <?php echo isset($stp['CarotidLt'])? ($stp['CarotidLt'] == "y"? "<font color=blue>Yes</font>": "") : "" ?>
                                                            <?php echo isset($stp['CarotidLt'])? ($stp['CarotidLt'] == "n"? "<font color=red>No</font>": "") : ";" ?>
                                                    </div></td>
                                                <td>Rt:</td>
                                                <td style="border-bottom: 1px dashed black"><div id="CarotidRt" class="d">
                                                        <?php echo isset($stp['CarotidRt'])? ($stp['CarotidRt'] == "y"? "<font color=blue>Yes</font>": "") : "" ?>
                                                        <?php echo isset($stp['CarotidRt'])? ($stp['CarotidRt'] == "n"? "<font color=red>No</font>": "") : "" ?>
                                                    </div></td></tr>
                                        </table>
                                    </td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                                <td><b><u>Heart</u></b>:</td>
                                                <td style="border-bottom: 1px dashed black"><div id="HeartNA" class="d1">
                                                        <?php echo isset($stp['HeartNA'])? ($stp['HeartNA'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>
                                                        <?php echo isset($stp['HeartNA'])? ($stp['HeartNA'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                                    </div></td>
                                                    <td><div id="Heart" style="color:blue"><?php echo isset($stp['Heart'])?$stp['Heart']:"" ?></div></td>
                                            </tr></table>
                                    </td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                            <td><b><u>Consciousness</u></b>:</td>
                                            <td>E </td>
                                            <td style="border-bottom: 1px dashed black" align="center"><div id="ConsciousnessE" class="d"><?php echo isset($stp['ConsciousnessE'])?$stp['ConsciousnessE']:"" ?></div></td>
                                            <td>M </td>
                                            <td style="border-bottom: 1px dashed black" align="center"><div id="ConsciousnessM" class="d"><?php echo isset($stp['ConsciousnessM'])?$stp['ConsciousnessM']:"" ?></div></td>
                                            <td>V </td>
                                            <td style="border-bottom: 1px dashed black" align="center"><div id="ConsciousnessV" class="d"><?php echo isset($stp['ConsciousnessV'])?$stp['ConsciousnessV']:"" ?></div></td>
                                        </tr></table>
                                   </td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><i><b>Orientation</b></i>:</td>
                                        <td>time</td><td style="border-bottom: 1px dashed black" align="center" width="100"><div id="OrientationTime" class="d2"><?php echo isset($stp['OrientationTime'])?$stp['OrientationTime']:"" ?></div></td>
                                        <td>place</td><td style="border-bottom: 1px dashed black" align="center" width="100"><div id="OrientationPlace" class="d2"><?php echo isset($stp['OrientationPlace'])?$stp['OrientationPlace']:"" ?></div></td>
                                        <td>person</td><td style="border-bottom: 1px dashed black" align="center" width="100"><div id="OrientationPerson" class="d2"><?php echo isset($stp['OrientationPerson'])?$stp['OrientationPerson']:"" ?></div></td>
                                            </tr></table>
                                   </td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><u><b>Speech</b></u>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Speech" class="d2">
                                                <?php echo isset($stp['Speech'])? ($stp['Speech'] == "d"? "dysarthric": "") : "" ?>
                                                <?php echo isset($stp['Speech'])? ($stp['Speech'] == "a"? "aphasic": "") : "" ?>
                                                <?php echo isset($stp['Speech'])? ($stp['Speech'] == "n"? "normal": "") : "" ?>
                                            </div></td>
                                        <td style="font-size: 10px;color: red">&nbsp;*(dysarthric,aphasic,normal)</td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><i><b>Type of aphasia</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Aphasia" class="d2">
                                                <?php echo isset($stp['Aphasia'])? ($stp['Aphasia'] == "m"? "motor": "") : "" ?>
                                                <?php echo isset($stp['Aphasia'])? ($stp['Aphasia'] == "s"? "sensory": "") : "" ?>
                                                <?php echo isset($stp['Aphasia'])? ($stp['Aphasia'] == "g"? "global": "") : "" ?>
                                        </div></td>
                                        <td style="font-size: 10px;color: red">&nbsp;*(motor,sensory,global)</td>
                                        </tr></table></td></tr>
                                <tr><td width="300">
                                        <table>
                                            <tr>
                                                <td><i><b>Fluency</b></i>:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="100">
                                                    <div id="Fluency" class="d2">
                                                       <?php echo isset($stp['Fluency'])? ($stp['Fluency'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>                                                                                                                                                                <?php echo isset($stp['Fluency'])? ($stp['Fluency'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                                    </div>
                                                </td>
                                            </tr></table>
                                    </td>
                                    <td>
                                        <table><tr>
                                        <td><i><b>Comprehension</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Comprehension" class="d2">
                                                <?php echo isset($stp['Comprehension'])? ($stp['Comprehension'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>
                                                <?php echo isset($stp['Comprehension'])? ($stp['Comprehension'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                        </div>
                                        </td></tr></table>
                                    </td></tr>
                                <tr><td>
                                        <table><tr>
                                        <td><i><b>Paraphasia</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Paraphasia" class="d2">
                                                <?php echo isset($stp['Paraphasia'])? ($stp['Paraphasia'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>
                                                <?php echo isset($stp['Paraphasia'])? ($stp['Paraphasia'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                            </div></td>
                                        </tr></table>
                                   </td>
                                   <td>
                                       <table><tr>
                                        <td>
                                        <i><b>Repetition</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Repetition" class="d2">
                                                    <?php echo isset($stp['Repetition'])? ($stp['Repetition'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>
                                                    <?php echo isset($stp['Repetition'])? ($stp['Repetition'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                        </div></td>
                                        </tr></table>
                                   </td></tr>
                                <tr><td>
                                        <table><tr>
                                                <td><i><b>Naming</b></i>:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="100"><div id="Naming" class="d2">
                                                    <?php echo isset($stp['Naming'])? ($stp['Naming'] == "n"? "<font color=blue>Normal</font>": "") : "" ?>
                                                    <?php echo isset($stp['Naming'])? ($stp['Naming'] == "a"? "<font color=red>Abnormal</font>": "") : "" ?>
                                        </div></td></tr></table>
                                    </td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                                <td><b><u>Cranial nerves</u></b>: Eye deviation in primary position</td>
                                                <td>L:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="CranialL" class="d2"><?php echo isset($stp['CranialL'])?$stp['CranialL']:"" ?></div>
                                                </td>
                                                <td>R:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="CranialR" class="d2"><?php echo isset($stp['CranialR'])?$stp['CranialR']:"" ?></div>
                                                </td>
                                            </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                                <td><b><u>Horner's syndrome</u></b>:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="100">
                                                    <div id="Horner" class="d2">
                                                        <?php echo isset($stp['Horner'])? ($stp['Horner'] == "-"? "-": "") : "" ?>
                                                        <?php echo isset($stp['Horner'])? ($stp['Horner'] == "+"? "+": "") : "" ?>
                                                    </div>
                                                </td>
                                        <td>(</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="HornerLR" class="d2">
                                                <?php echo isset($stp['HornerLR'])? ($stp['HornerLR'] == "r"? "Rt": "") : "" ?>
                                                <?php echo isset($stp['HornerLR'])? ($stp['HornerLR'] == "l"? "Lt": "") : "" ?>
                                            </div>
                                        </td>
                                        <td>)</td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table>
                                            <tr align="left">
                                                <td><i><b>Pupils</b></i>:</td>
                                                <td>Lt</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90"><div id="PupilsLt" class="d2"><?php echo isset($stp['PupilsLt'])?$stp['PupilsLt']:"" ?></div></td>
                                                <td>mm.</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90"><div id="PupilsLtc" class="d2">
                                                    <?php echo isset($stp['PupilsLtc'])? ($stp['PupilsLtc'] == "g"? "good": "") : "" ?>
                                                    <?php echo isset($stp['PupilsLtc'])? ($stp['PupilsLtc'] == "s"? "sluggish": "") : "" ?>
                                                    <?php echo isset($stp['PupilsLtc'])? ($stp['PupilsLtc'] == "n"? "not reactive to light": "") : "" ?>
                                                </div>
                                                </td>
                                            </tr>
                                            <tr><td></td>
                                                <td>Rt </td><td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="PupilsRt" class="d2"><?php echo isset($stp['PupilsRt'])?$stp['PupilsRt']:"" ?></div></td>
                                                <td>mm.</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90"><div id="PupilsRtc" class="d2">
                                                    <?php echo isset($stp['PupilsRtc'])? ($stp['PupilsRtc'] == "g"? "good": "") : "" ?>
                                                    <?php echo isset($stp['PupilsRtc'])? ($stp['PupilsRtc'] == "s"? "sluggish": "") : "" ?>
                                                    <?php echo isset($stp['PupilsRtc'])? ($stp['PupilsRtc'] == "n"? "not reactive to light": "") : "" ?></div></td></tr>
                                        </table></td></tr>
                                <tr><td colspan="2">
                                        <table>
                                            <tr>
                                                <td width="50"><b>VA</b>:</td>
                                                <td>Lt</td><td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="VALt" class="d2"><?php echo isset($stp['VALt'])?$stp['VALt']:"" ?></div></td>
                                                <td>Rt</td><td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="VARt" class="d2"><?php echo isset($stp['VARt'])?$stp['VARt']:"" ?></div></td>
                                                <td width="50"><b>VF</b>:</td>
                                        <td >Lt</td><td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="VFLt" class="d2"><?php echo isset($stp['VFLt'])?$stp['VFLt']:"" ?></div></td>
                                        <td>Rt</td><td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="VFRt" class="d2"><?php echo isset($stp['VFRt'])?$stp['VFRt']:"" ?></div></td></tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><i><b>Facial weakness</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="60">
                                            <div id="FacialWeaknessLR" class="d2">
                                                <?php echo isset($stp['FacialWeaknessLR'])? ($stp['FacialWeaknessLR'] == "l"? "Lt": "") : "" ?>
                                                <?php echo isset($stp['FacialWeaknessLR'])? ($stp['FacialWeaknessLR'] == "r"? "Rt": "") : "" ?></div>
                                        </td><td style="font-size: 10px;color:red;">&nbsp;*(Lt,Rt)</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="60">
                                            <div id="FacialWeaknessUL" class="d2">
                                                <?php echo isset($stp['FacialWeaknessUL'])? ($stp['FacialWeaknessUL'] == "u"? "UMN": "") : "" ?>
                                                <?php echo isset($stp['FacialWeaknessUL'])? ($stp['FacialWeaknessUL'] == "l"? "LMN": "") : "" ?></div>
                                        </td><td style="font-size: 10px;color:red;">&nbsp;*(UMN,LMN)</td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><i><b>Tongue deviation</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="60">
                                            <div id="TongueDeviationYN" class="d2">
                                                <?php echo isset($stp['TongueDeviationYN'])? ($stp['TongueDeviationYN'] == "y"? "Y": "") : "" ?>
                                                <?php echo isset($stp['TongueDeviationYN'])? ($stp['TongueDeviationYN'] == "n"? "N": "") : "" ?>
                                            </div></td>
                                        <td><div id="TongueDeviationLR" class="d2">
                                        <?php   if(isset($stp['TongueDeviationYN']) && $stp['TongueDeviationYN']=="y") {?>
                                        <?php      echo isset($stp['TongueDeviationLR'])? ($stp['TongueDeviationLR'] == "l"? "To (Lt)": "") : ""; ?>
                                        <?php      echo isset($stp['TongueDeviationLR'])? ($stp['TongueDeviationLR'] == "r"? "To (Rt)": "") : "";}?></div></td>
                                        <td></td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                        <td><i><b>Gag reflex</b></i>:</td>
                                        <td>Lt</td><td style="border-bottom: 1px dashed black" align="center" width="60">
                                            <div id="GagReflexL" class="d2"><?php echo isset($stp['GagReflexL'])?$stp['GagReflexL']:"" ?></div></td><td>/</td>
                                        <td>Rt </td><td style="border-bottom: 1px dashed black" align="center" width="60">
                                            <div id="GagReflexR" class="d2"><?php echo isset($stp['GagReflexR'])?$stp['GagReflexR']:"" ?></div></td>
                                        <td>Uvula:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="UvalaMD" class="d2">
                                                    <?php echo isset($stp['UvalaMD'])? ($stp['UvalaMD'] == "m"? "midline": "") : "" ?>
                                                    <?php echo isset($stp['UvalaMD'])? ($stp['UvalaMD'] == "d"? "deviate to ": "") : "" ?>                                                    
                                            </div></td><td style="border-bottom: 1px dashed black" align="center">
                                                <div id="UvalaMD" class="d2">
                                                    <?php if(isset($stp['UvalaMD'])&& $stp['UvalaMD'] == "d"){?>
                                                        <?php echo isset($stp['UvalaLR'])? ($stp['UvalaLR'] == "l"? "Lt": "") : "" ?>
                                                        <?php echo isset($stp['UvalaLR'])? ($stp['UvalaLR'] == "r"? "Rt": "") : "" ?>
                                                    <?}?>
                                                </div></td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table cellspacing="0" style="margin: 10px">
                                            <tr><td width="80"><u><b>Motor</b></u>:</td>
                                                <td>prox. </td>
                                                    <td style="border-bottom: 1px dashed black" align="center" width="60"><div id="MotorLTp" class="d"><?php echo isset($stp['MotorLTp'])?$stp['MotorLTp']:"" ?></div></td>
                                                <td>/</td>
                                                <td>distal </td>
                                                    <td style="border-bottom: 1px dashed black" align="center" width="60"><div id="MotorLTd" class="d"><?php echo isset($stp['MotorLTd'])?$stp['MotorLTd']:"" ?></div></td>
                                                <td style="border-left: black 2px solid">
                                                    prox.</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="60"><div id="MotorRTp" class="d"><?php echo isset($stp['MotorRTp'])?$stp['MotorRTp']:"" ?></div></td><td>/</td>
                                                <td>distal</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="60"><div id="MotorRTd" class="d"><?php echo isset($stp['MotorRTd'])?$stp['MotorRTd']:"" ?></div></td></tr>
                                            <tr><td></td>
                                                <td style="border-top: 2px solid black;">prox. </td>
                                                <td style="border-top: 2px solid black;border-bottom: 1px dashed black"  align="center" width="60"><div id="MotorLBp" class="d2"><?php echo isset($stp['MotorLBp'])?$stp['MotorLBp']:"" ?></div></td><td style="border-top: 2px solid black;">/</td>
                                                <td style="border-top: 2px solid black;">distal </td>
                                                <td style="border-top: 2px solid black;border-bottom: 1px dashed black"  align="center" width="60"><div id="MotorLBd" class="d2"><?php echo isset($stp['MotorLBd'])?$stp['MotorLBd']:"" ?></div></td>
                                                <td style="border-left: 2px solid black;border-top: 2px solid black">
                                                    prox.</td>
                                                <td style="border-top: 2px solid black;border-bottom: 1px dashed black" align="center" width="60"><div id="MotorRBp" class="d2"><?php echo isset($stp['MotorRBp'])?$stp['MotorRBp']:"" ?></div></td><td style="border-top: 2px solid black;">/</td>
                                                <td style="border-top: 2px solid black;">distal </td>
                                                <td style="border-top: 2px solid black;border-bottom: 1px dashed black" align="center" width="60"><div id="MotorRBd" class="d2"><?php echo isset($stp['MotorRBd'])?$stp['MotorRBd']:"" ?></div></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                                <td><i><b>Pronator drifting</b></i>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="60"><div id="PronatorDriftingLR" class="d">
                                                <?php echo isset($stp['PronatorDriftingLR'])? ($stp['PronatorDriftingLR'] == "l"? "Lt": "") : "" ?>
                                                <?php echo isset($stp['PronatorDriftingLR'])? ($stp['PronatorDriftingLR'] == "r"? "Rt": "") : "" ?>
                                        </div></td>
                                        </tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table style="font-size: 16px"><tr>
                                        <td style="font-size: 18px"><u><b>Cerebellar signs</b></u>:</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="30"><div id="CerebellarYN" class="d2">
                                                <?php echo isset($stp['CerebellarYN'])? ($stp['CerebellarYN'] == "y"? "Yes": "") : "" ?>
                                                <?php echo isset($stp['CerebellarYN'])? ($stp['CerebellarYN'] == "n"? "No": "") : "" ?>
                                            </div>
                                        </td>
                                        <td>Gait ataxia</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="30">
                                            <div id="CerebellarGLR" class="d2">
                                                <?php echo isset($stp['CerebellarGLR'])? ($stp['CerebellarGLR'] == "l"? "Lt": "") : "" ?>
                                                <?php echo isset($stp['CerebellarGLR'])? ($stp['CerebellarGLR'] == "r"? "Rt": "") : "" ?></div>
                                        </td>
                                        <td>,</td>
                                        <td>Trunkal ataxia</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="30">
                                            <div id="CerebellarTYN" class="d2">
                                            <?php echo isset($stp['CerebellarTYN'])? ($stp['CerebellarTYN'] == "y"? "Yes": "") : "" ?>
                                            <?php echo isset($stp['CerebellarTYN'])? ($stp['CerebellarTYN'] == "n"? "No": "") : "" ?>
                                            </div>
                                        </td><td>,</td>
                                        <td>Finger to nose</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="30">
                                            <div id="CerebellarFYN" class="d2">
                                            <?php echo isset($stp['CerebellarFYN'])? ($stp['CerebellarFYN'] == "y"? "Yes": "") : "" ?>
                                            <?php echo isset($stp['CerebellarFYN'])? ($stp['CerebellarFYN'] == "n"? "No": "") : "" ?></div>
                                        </td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td colspan="2">
                                        <table>
                                            <tr>
                                                <td valign="top" rowspan="3"><u><b>Sensory</b></u>:</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="90">
                                                    <div id="SensoryTMD" class="d2">
                                                        <?php echo isset($stp['SensoryTMD'])? ($stp['SensoryTMD'] == "n"? "Normal": "") : "" ?>
                                                        <?php echo isset($stp['SensoryTMD'])? ($stp['SensoryTMD'] == "h"? "Hemianesthenia": "") : "" ?>                                                        
                                                        <?php echo isset($stp['SensoryTMD'])? ($stp['SensoryTMD'] == "p"? "Parhal hemisensory loss": "") : "" ?>                                                        
                                                    </div>
                                                </td>
                                                <td>
                                                    <div id="SensoryHlr">
                                                        <?php if(isset($stp['SensoryTMD']) && $stp['SensoryTMD'] == "h"){?>
                                                            <?php echo isset($stp['SensoryHlr'])? ($stp['SensoryHlr'] == "l"? "Lt": "") : "" ?>
                                                            <?php echo isset($stp['SensoryHlr'])? ($stp['SensoryHlr'] == "r"? "Rt": "") : "" ?>
                                                        <?}?>
                                                    </div>
                                                </td>
                                                <td><div id="SensoryPlr">
                                                        <?php if(isset($stp['SensoryTMD']) && $stp['SensoryTMD'] == "p"){?>
                                                            <?php echo isset($stp['SensoryPlr'])? ($stp['SensoryPlr'] == "l"? "Lt": "") : "" ?>
                                                            <?php echo isset($stp['SensoryPlr'])? ($stp['SensoryPlr'] == "r"? "Rt": "") : "" ?>
                                                        <?}?>
                                                    </div>
                                                </td>
                                                <td><div id="SensoryP">
                                                        <?php if(isset($stp['SensoryTMD']) && $stp['SensoryTMD'] == "p"){?>
                                                            <?php echo isset($stp['SensoryP'])?"(".$stp['SensoryP'].")":"" ?>
                                                        <?}?>
                                                    </div>
                                                </td>
                                            <td style="font-size: 10px;color: red" colspan="5">&nbsp;*(Normal,Hemianesthenia,Parhal hemisensory loss)</td></tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                          <td>Neglect</td>
                                          <td>Lt </td>
                                          <td style="border-bottom: 1px dashed black" align="center" width="90"><div id="NeglectLt" class="d2">
                                                        <?php echo isset($stp['NeglectLt'])?($stp['NeglectLt']=="n"?"<font color=blue>Normal</font>":""):"" ?>
                                                        <?php echo isset($stp['NeglectLt'])?($stp['NeglectLt']=="a"?"<font color=red>Abnormal</font>":""):"" ?>
                                          </div>
                                          <td>,</td>
                                          <td>Rt </td>
                                          <td style="border-bottom: 1px dashed black" align="center" width="90">
                                              <div id="NeglectRt" class="d2">
                                                        <?php echo isset($stp['NeglectRt'])?($stp['NeglectRt']=="n"?"<font color=blue>Normal</font>":""):""?>
                                                        <?php echo isset($stp['NeglectRt'])?($stp['NeglectRt']=="a"?"<font color=red>Abnormal</font>":""):""?>
                                                </div>
                                          </td></tr></table></td></tr>
                                <tr><td colspan="2">
                                        <table><tr>
                                                <td>Proprioception</td>
                                        <td>Lt</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="ProprioceptionLt" class="d2">
                                                        <?php echo isset($stp['ProprioceptionLt'])?($stp['ProprioceptionLt']=="n"?"<font color=blue>Normal</font>":""):"" ?>
                                                        <?php echo isset($stp['ProprioceptionLt'])?($stp['ProprioceptionLt']=="a"?"<font color=red>Abnormal</font>":""):"" ?>
                                            </div></td><td>,</td>
                                        <td>Rt</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="90">
                                            <div id="ProprioceptionRt" class="d2">
                                                        <?php echo isset($stp['ProprioceptionRt'])?($stp['ProprioceptionRt']=="n"?"<font color=blue>Normal</font>":""):"" ?>
                                                        <?php echo isset($stp['ProprioceptionRt'])?($stp['ProprioceptionRt']=="a"?"<font color=red>Abnormal</font>":""):"" ?>
                                            </div>
                                           </td>
                                        </tr></table>
                                    </td></tr>

                                <tr><td colspan="2">
                                        <table style="margin: 10px; border: 1px solid black; padding: 5px" width="97%">
                                            <tr><td>
                                                    <u><b>Final Dx:</b></u></td>
                                                <td style="border-bottom: 1px dashed black" width="300"><div id="FinalDXHI" class="d2">
                                                        <?php echo isset($stp['FinalDXHI'])? ($stp['FinalDXHI'] == "i"? "<b>Ischemic stroke </b>": "") : "" ?>
                                                        <?php echo isset($stp['FinalDXHI'])? ($stp['FinalDXHI'] == "h"? "<b>Hemorrhagic stroke</b>": "") : "" ?>
                                                    </div></td>
                                                <td>
                                                    <div id="FinalDXHType" class="d2">
                                                        <?php if(isset($stp['FinalDXHI'])&& $stp['FinalDXHI'] == "h"){?>
                                                            <?php echo isset($stp['FinalDXHType'])?$stp['FinalDXHType']:"" ?>
                                                        <?php }?>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr><td></td><td style="font-size: 10px">&nbsp;*(Ischemic stroke,Hemorrhagic stroke)</td></tr>                                            
                                            <tr><td width="100"><b>Vessel:</b></td>
                                                <td style="border-bottom: 1px dashed black" width="300">
                                                    <table width="300"><tr><td>
                                                    <div id="VesselAP" class="d2">                                                        
                                                        <?php echo isset($stp['VesselAP'])? ($stp['VesselAP'] == "a"? "Anterior circulation :": "") : "" ?>
                                                        <?php echo isset($stp['VesselAP'])? ($stp['VesselAP'] == "p"? "Posterior circulation:": "") : "" ?>
                                                        </div></td><td>
                                                        <div id="VesselAc" class="d2">
                                                                <?php if(isset($stp['VesselAP'])&& $stp['VesselAP'] == "a") {?>
                                                                    <?php echo isset($stp['VesselAc'])? ($stp['VesselAc'] == "a"? "ACA": "") : "" ?>
                                                                    <?php echo isset($stp['VesselAc'])? ($stp['VesselAc'] == "m"? "MCA ": "") : "" ?>
                                                        </div>
                                                        <?php }?></td>
                                                        <td>
                                                            <div id="VesselPc" style="color: blue;">
                                                            <?php if(isset($stp['VesselAP'])&&$stp['VesselAP'] == "p") {?>
                                                            
                                                                <?php echo isset($stp['VesselPc'])? ($stp['VesselPc'] == "pc"? "PCA": "") : "" ?>
                                                                <?php echo isset($stp['VesselPc'])? ($stp['VesselPc'] == "vb"? "VB": "") : "" ?>
                                                                <?php echo isset($stp['VesselPc'])? ($stp['VesselPc'] == "pi"? "PICA": "") : "" ?>
                                                                <?php echo isset($stp['VesselPc'])? ($stp['VesselPc'] == "ai"? "AICA": "") : "" ?>
                                                                <?php echo isset($stp['VesselPc'])? ($stp['VesselPc'] == "ce"? "Cerebellar": "") : "" ?>
                                                           </div>
                                                            <?}?>                                                                                                            
                                                        </td></tr>
                                                    </table></td></tr>
                                            <tr><td><b>Cause:</b></td>
                                                <td style="border-bottom: 1px dashed black">
                                                    <table><tr>
                                               <td>
                                                   <div id="Cause" class="d2">
                                                            <?php echo isset($stp['Cause'])? ($stp['Cause'] == "e"? "<b>Emboli :</b>": "") : "" ?>                                                            
                                                            <?php echo isset($stp['Cause'])? ($stp['Cause'] == "t"? "<b>Thrombosis</b>": "") : "" ?>
                                                            <?php echo isset($stp['Cause'])? ($stp['Cause'] == "l"? "<b>Lacunar stroke </b>: type": "") : "" ?>
                                                            <?php echo isset($stp['Cause'])? ($stp['Cause'] == "o"? "<b>Others</b>": "") : "" ?>
                                                    </div>
                                                </td>
                                                <td>
                                                    <div id="CauseE" class="d2">
                                                    <?php if(isset($stp['Cause'])&&$stp['Cause'] == "e"){?>
                                                        <?php echo isset($stp['CauseE'])? ($stp['CauseE'] == "c"? "cardiac": "") : "" ?>
                                                        <?php echo isset($stp['CauseE'])? ($stp['CauseE'] == "a"? "artery": "") : "" ?>
                                                        <?php echo isset($stp['CauseE'])? ($stp['CauseE'] == "u"? "unknown": "") : "" ?>
                                                    <?php }?>                                                    
                                                    </div>
                                                </td>
                                                <td>
                                                    <div id="CauseLType" class="d2">
                                                    <?php if(isset($stp['Cause'])&&$stp['Cause'] == "l"){?>
                                                        <?php echo isset($stp['CauseLType'])? ($stp['CauseLType'] == "pm"? "Pure motor syndrome": "") : "" ?>
                                                        <?php echo isset($stp['CauseLType'])? ($stp['CauseLType'] == "ps"? "Pure sensory syndrome": "") : "" ?>
                                                        <?php echo isset($stp['CauseLType'])? ($stp['CauseLType'] == "ah"? "Ataxic hemiparesis": "") : "" ?>
                                                        <?php echo isset($stp['CauseLType'])? ($stp['CauseLType'] == "dc"? "Dysarthria clumsy hand syndrome": "") : "" ?>
                                                        <?php echo isset($stp['CauseLType'])? ($stp['CauseLType'] == "sm"? "Sensori-motor syndrome": "") : "" ?>
                                                    <?php }?>
                                                    </div>
                                                </td>
                                                <td>
                                                    <div id="CauseOther" class="d2">
                                                    <?php if(isset($stp['Cause'])&&$stp['Cause'] == "o"){?>
                                                        <?php echo isset($stp['CauseOther'])? $stp['CauseOther']: "" ?>
                                                    <?php }?>
                                                    </div>
                                                </td></tr></table>
                                                </td>
                                            </tr>                                                                                                                                                                                                                                                                                                   
                                            <tr><td><b>Stage</b> :</td>
                                                <td style="border-bottom: 1px dashed black">
                                                    <div id="Stage" class="d2">
                                                    <?php echo isset($stp['Stage'])? ($stp['Stage'] == "s"? "Stable": "") : "" ?>
                                                    <?php echo isset($stp['Stage'])? ($stp['Stage'] == "p"? "Progressive": "") : "" ?>
                                                    <?php echo isset($stp['Stage'])? ($stp['Stage'] == "c"? "Completed": "") : "" ?>
                                                    <?php echo isset($stp['Stage'])? ($stp['Stage'] == "i"? "Improved": "") : "" ?>
                                                    <?php echo isset($stp['Stage'])? ($stp['Stage'] == "t"? "TIA": "") : "" ?>
                                                    </div>
                                                    </td></tr>
                                        </table>
                                    </td></tr>
                                <tr><td colspan="2"><table><tr><td><b>Other</b></td><td style="border-bottom: 1px dashed black" width="500">
                                        <div id="stp_others" class="d2"><?php echo isset($stp['stp_others'])?$stp['stp_others']:"" ?></div></td></tr></table></td></tr>
                                <tr><td colspan="2"><table><tr><td><b>Provisional Diagnosis</b></td><td style="border-bottom: 1px dashed black" width="400">
                                                    <div id="ProvisionalDiagnosis" class="d2"><?php echo isset($stp['ProvisionalDiagnosis'])?$stp['ProvisionalDiagnosis']:"" ?></div></td></tr></table></td></tr>
                            </tbody>
                        </table>
                        </div>

                        <div id="tabs-4">
                            <table id="users" class="ui-widget ui-widget-content ui-corner-all" width="100%" style="margin-top: 10px;padding-bottom: 10px;">
                            <thead>
                                <tr class="ui-widget-header ">
                                    <th colspan="7" align="left" style="padding: 10px">Laboratory screen for exclusion</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td>
                                        <table style="width: 100%;border: solid 1px silver">
                                            <tr>
                                                <td valign="middle" align="center">
                                                    <div align="left"><b>CT Scan File</b></div>
                                                     <div id="CTScanFile" ></div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td></tr>
                                <tr><td><input type="checkbox" id="CTscanYN"name="CTscanYN" disabled <?php echo isset($lab['CTscanYN'])? ($lab['CTscanYN'] == "true"? "checked": "") : "" ?>>CT scan                                        </td></tr>
                                <tr><td>&nbsp;&nbsp;
                                        <input type="checkbox" id="CTNoICHYN" name="CTNoICHYN" disabled <?php echo isset($lab['CTNoICHYN'])? ($lab['CTNoICHYN'] == "true"? "checked": "") : "" ?>> No ICH
                                        <input type="checkbox" id="CTnobrainYN" name="CTnobrainYN"  disabled <?php echo isset($lab['CTnobrainYN'])? ($lab['CTnobrainYN'] == "true"? "checked": "") : "" ?>> no brain edema/shiffing </td></tr>
                                <!--<tr><td><input type="checkbox" id="CTPerfusionYN" name="CTPerfusionYN"  disabled <?php echo isset($lab['CTPerfusionYN'])? ($lab['CTPerfusionYN'] == "true"? "checked": "") : "" ?>> Phinal</td></tr>-->
                                <tr><td><table><tr><td><input type="checkbox" id="MRIYN" disabled name="MRIYN" <?php echo isset($lab['MRIYN'])? ($lab['MRIYN'] == "true"? "checked": "") : "" ?>></td>
                                                <td>MRI result:</td><td style="border-bottom: 1px dashed black" align="center" width="100"> <div id="MRIResult" class="d2"><?php echo isset($lab['MRIResult'])?$lab['MRIResult']:"" ?></div></td></tr></table></td></tr>
                                <tr><td>&nbsp;&nbsp;<input type="checkbox" id="MRINoICHYN" name="MRINoICHYN" disabled <?php echo isset($lab['MRINoICHYN'])? ($lab['MRINoICHYN'] == "true"? "checked": "") : "" ?>> No ICH
                                        <input type="checkbox" id="MRInobrainYN" name="MRInobrainYN" disabled <?php echo isset($lab['MRInobrainYN'])? ($lab['MRInobrainYN'] == "true"? "checked": "") : "" ?>> no brain edema/shiffing </td></tr>
                                <tr><td>&nbsp;&nbsp;<input type="checkbox" id="MRIDWI30YN" name="MRIDWI30YN" disabled <?php echo isset($lab['MRIDWI30YN'])? ($lab['MRIDWI30YN'] == "true"? "checked": "") : "" ?>> DWI &le; 30% of MCA territory </td></tr>
                                <tr><td>&nbsp;&nbsp;<input type="checkbox" id="MRIDWIPWIYN" name="MRIDWIPWIYN" disabled <?php echo isset($lab['MRIDWIPWIYN'])? ($lab['MRIDWIPWIYN'] == "true"? "checked": "") : "" ?>> DWI / PWI mismatch </td></tr>
                                <tr><td><input type="checkbox" id="MRAYN" name="MRAYN" disabled <?php echo isset($lab['MRAYN'])? ($lab['MRAYN'] == "true"? "checked": "") : "" ?>> MRA</td></tr>
                                <tr><td><table><tr><td>&nbsp;
                                        <input type="checkbox" id="MRAMCAYN" name="MRAMCAYN" disabled <?php echo isset($lab['MRAMCAYN'])? ($lab['MRAMCAYN'] == "true"? "checked": "") : "" ?>> MCA</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100">
                                        <div id="MRAMCAso" class="d2">
                                        <?php if(isset($lab['MRAMCAYN']) && $lab['MRAMCAYN'] == "true"){?>                                                                                
                                                <?php echo isset($lab['MRAMCAso'])? ($lab['MRAMCAso'] == "s"? "(Stenosis)": "") : "" ?>
                                                <?php echo isset($lab['MRAMCAso'])? ($lab['MRAMCAso'] == "o"? "(Occlusion)": "") : "" ?>                                        
                                        <?php }?>
                                        </div></td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td><table><tr><td>&nbsp;
                                           <input type="checkbox" id="MRAACAYN" name="MRAACAYN" disabled <?php echo isset($lab['MRAACAYN'])? ($lab['MRAACAYN'] == "true"? "checked": "") : "" ?>> ACA</td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100">
                                        <div id="MRAACAso" class="d2">
                                        <?php if(isset($lab['MRAACAYN']) && $lab['MRAACAYN'] == "true"){?>
                                        
                                                 <?php echo isset($lab['MRAACAso'])? ($lab['MRAACAso'] == "s"? "(Stenosis)": "") : "" ?>
                                                 <?php echo isset($lab['MRAACAso'])? ($lab['MRAACAso'] == "o"? "(Occlusion)": "") : "" ?>
                                        
                                        <?php }?>
                                        </div></td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td><table>
                                        <tr>
                                        <td>&nbsp;
                                                <input type="checkbox" id="MRABAYN" name="MRABAYN" disabled <?php echo isset($lab['MRABAYN'])? ($lab['MRABAYN'] == "true"? "checked": "") : "" ?>> BA
                                        </td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100">
                                        <div id="MRABAso" class="d2">
                                        <?php if(isset($lab['MRABAYN']) && $lab['MRABAYN'] == "true"){?>
                                       
                                                <?php echo isset($lab['MRABAso'])? ($lab['MRABAso'] == "s"? "(Stenosis)": "") : "" ?>
                                                <?php echo isset($lab['MRABAso'])? ($lab['MRABAso'] == "o"? "(Occlusion)": "") : "" ?>
                                        
                                        <?php }?>
                                        </div></td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td><table>
                                        <tr>
                                        <td>&nbsp;
                                            <input type="checkbox" id="MRAICAYN" name="MRAICAYN" disabled <?php echo isset($lab['MRAICAYN'])? ($lab['MRAICAYN'] == "true"? "checked": "") : "" ?>> ICA
                                        </td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100">
                                        <div id="MRAICAso" class="d2">
                                        <?php if(isset($lab['MRAICAYN']) && $lab['MRAICAYN'] == "true"){?>                                        
                                            <?php echo isset($lab['MRAICAso'])? ($lab['MRAICAso'] == "s"? "(Stenosis)": "") : "" ?>
                                            <?php echo isset($lab['MRAICAso'])? ($lab['MRAICAso'] == "o"? "(Occlusion)": "") : "" ?>
                                        
                                        <?php }?>
                                        </div></td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td><table>
                                        <tr>
                                        <td>&nbsp;
                                            <input type="checkbox" id="MRAotherYN" name="MRAotherYN" disabled <?php echo isset($lab['MRAotherYN'])? ($lab['MRAotherYN'] == "true"? "checked": "") : "" ?>> other
                                        </td>
                                        <td style="border-bottom: 1px dashed black" align="center" width="100">
                                            <div id="MRAother" class="d2">
                                            <?php if(isset($lab['MRAotherYN']) && $lab['MRAotherYN'] == "true"){?>
                                                <?php echo isset($lab['MRAother'])?$lab['MRAother']:"" ?>
                                            <?php }?>
                                            </div>
                                        </td>
                                        </tr></table>
                                    </td></tr>
                                <tr><td><hr></td></tr>
                                <tr><td>Blood test result</td></tr>
                                <tr>
                                    <td>
                                        <table>
                                            <tr>
                                                <td>PG</td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="80"><div id="BloodPG" class="d2"><?php echo isset($lab['BloodPG'])?$lab['BloodPG']:"" ?></div></td>
                                                <td> mg/dl</td>
                                            </tr>
                                            <tr>
                                                <td>PT </td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="80"><div id="BloodPT" class="d2"><?php echo isset($lab['BloodPT'])?$lab['BloodPT']:"" ?></div></td>
                                                <td> sec.</td>
                                            </tr>
                                            <tr>
                                                <td>PTT </td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="80"><div id="BloodPTT" class="d2"><?php echo isset($lab['BloodPTT'])?$lab['BloodPTT']:"" ?></div></td>
                                                <td> sec.</td>
                                            </tr>
                                            <tr>
                                                <td>PLT </td>
                                                <td style="border-bottom: 1px dashed black" align="center" width="80"><div id="BloodPLT" class="d2"><?php echo isset($lab['BloodPLT'])?$lab['BloodPLT']:"" ?></div></td>
                                                <td> /cumm.</td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table style="margin-left: 20px">
                                            <tr>
                                                <td width="400" id="td_BloodPGYN">
                                                    <input type="checkbox" id="BloodPGYN" name="BloodPGYN" disabled <?php echo isset($lab['BloodPGYN'])? ($lab['BloodPGYN'] == "true"? "checked": "") : "" ?>> PG > 50 < 400 mg/dl</td>
                                                <td id="td_BloodPLTYN">
                                                    <input type="checkbox" id="BloodPLTYN" name="BloodPLTYN" disabled <?php echo isset($lab['BloodPLTYN'])? ($lab['BloodPLTYN'] == "true"? "checked": "") : "" ?>> PLT > 100,000</td>
                                            </tr>
                                            <tr>
                                                <td><input type="checkbox" id="BloodINRYN" name="BloodINRYN" disabled <?php echo isset($lab['BloodINRYN'])? ($lab['BloodINRYN'] == "true"? "checked": "") : "" ?>> INR < 1.7 </td><td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </div>

                        <div id="tabs-5">
                            <table width="100%" class="ui-widget ui-widget-content ui-corner-all" cellspacing="0">
                                <tr class="ui-widget-header ">
                                    <td colspan="3">ข้อบ่งชี้</td>
                                </tr>
                                <tr id="estimate_i1_tro">
                                    <td>
                                        <div id="estimate_i1_r">
                                            <input type="radio" id="estimate_i1_ra" name="estimate_i1_r" onchange="verify_estimate('estimate_i1')"/><label for="estimate_i1_ra">A</label>
                                            <input type="radio" id="estimate_i1_ri" name="estimate_i1_r" onchange="verify_estimate('estimate_i1')"/><label for="estimate_i1_ri">I</label>
                                        </div>
                                    </td>
                                    <td>
                                        <input type="checkbox" id="estimate_i1" name="estimate_i1" disabled <?php echo isset($est['estimate_i1'])? ($est['estimate_i1'] == "true"? "checked": "") : "" ?>>
                                    </td>
                                    <td>1. มีอาการของสมองขาดเลือดภายใน 4.5 ชั่วโมง</td>
                                </tr>
                                <tr bgcolor="#E4E4E4" id="estimate_i2_tro">
                                    <td>
                                        <div id="estimate_i2_r">
                                            <input type="radio" id="estimate_i2_ra" name="estimate_i2_r" onchange="verify_estimate('estimate_i2')"/><label for="estimate_i2_ra">A</label>
                                            <input type="radio" id="estimate_i2_ri" name="estimate_i2_r" onchange="verify_estimate('estimate_i2')"/><label for="estimate_i2_ri">I</label>
                                        </div>
                                    </td>
                                    <td><input type="checkbox" id="estimate_i2" disabled <?php echo isset($est['estimate_i2'])? ($est['estimate_i2'] == "true"? "checked": "") : "" ?> name="estimate_i2" ></td>
                                    <td>2. มีความผิดปกติทางระบบประสาทที่ตรวจพบได้</td>
                                </tr>
                                <tr id="estimate_i3_tro">
                                    <td width="100">
                                        <div id="estimate_i3_r">
                                            <input type="radio" id="estimate_i3_ra" name="estimate_i3_r" onchange="verify_estimate('estimate_i3')"/><label for="estimate_i3_ra">A</label>
                                            <input type="radio" id="estimate_i3_ri" name="estimate_i3_r" onchange="verify_estimate('estimate_i3')"/><label for="estimate_i3_ri">I</label>
                                        </div>
                                    </td>
                                    <td><input type="checkbox" id="estimate_i3" name="estimate_i3" disabled <?php echo isset($est['estimate_i3'])? ($est['estimate_i3'] == "true"? "checked": "") : "" ?>></td>
                                    <td>3. ผลการตรวจเอกซเรย์คอมพิวเตอร์สมองไม่พบว่ามีเลือดออกในเนื้อสมองหรือเลือดออกในชั้นใต้เยื่อหุ้มสมอง</td>
                                </tr>
                            </table>
                            <br>
                            <table width="100%" class="ui-widget ui-widget-content ui-corner-all" cellspacing="0">
                                <tr class="ui-widget-header "><td colspan="3">ข้อห้าม</td></tr>                                
                                   <tr id="estimate_d1_tro">
                                       <td width="100">
                                            <div id="estimate_d1_r">
                                                <input type="radio" id="estimate_d1_ra" name="estimate_d1_r" onchange="verify_estimate('estimate_d1')"/><label for="estimate_d1_ra">A</label>
                                                <input type="radio" id="estimate_d1_ri" name="estimate_d1_r" onchange="verify_estimate('estimate_d1')"/><label for="estimate_d1_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d1" name="estimate_d1" disabled <?php echo isset($est['estimate_d1'])? ($est['estimate_d1'] == "true"? "checked": "") : "" ?>></td>
                                       <td>1. มีประวัติเลือดออกในสมองมาก่อน</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d2_tro">
                                       <td width="100">
                                            <div id="estimate_d2_r">
                                                <input type="radio" id="estimate_d2_ra" name="estimate_d2_r" onchange="verify_estimate('estimate_d2')"/><label for="estimate_d2_ra">A</label>
                                                <input type="radio" id="estimate_d2_ri" name="estimate_d2_r" onchange="verify_estimate('estimate_d2')"/><label for="estimate_d2_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d2" name="estimate_d2" disabled <?php echo isset($est['estimate_d2'])? ($est['estimate_d2'] == "true"? "checked": "") : "" ?>></td>
                                       <td>2. มีประวัติบาดเจ็บที่ศีรษะรุนแรงภายใน 3 เดือน</td>
                                   </tr>
                                   <tr id="estimate_d3_tro">
                                       <td width="100">
                                            <div id="estimate_d3_r">
                                                <input type="radio" id="estimate_d3_ra" name="estimate_d3_r" onchange="verify_estimate('estimate_d3')"/><label for="estimate_d3_ra">A</label>
                                                <input type="radio" id="estimate_d3_ri" name="estimate_d3_r" onchange="verify_estimate('estimate_d3')"/><label for="estimate_d3_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d3" name="estimate_d3" disabled <?php echo isset($est['estimate_d3'])? ($est['estimate_d3'] == "true"? "checked": "") : "" ?>></td>
                                       <td>3. มีประวัติผ่าตัดใหญ่ภายใน 14 วัน</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d4_tro">
                                       <td width="100">
                                            <div id="estimate_d4_r">
                                                <input type="radio" id="estimate_d4_ra" name="estimate_d4_r" onchange="verify_estimate('estimate_d4')"/><label for="estimate_d4_ra">A</label>
                                                <input type="radio" id="estimate_d4_ri" name="estimate_d4_r" onchange="verify_estimate('estimate_d4')"/><label for="estimate_d4_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d4" name="estimate_d4" disabled <?php echo isset($est['estimate_d4'])? ($est['estimate_d4'] == "true"? "checked": "") : "" ?>></td>
                                       <td>4. มีเลือดออกในทางเดินอาหาร หรือทางเดินปัสสาวะภายใน 21 วัน</td>
                                   </tr>
                                   <tr id="estimate_d5_tro">
                                       <td width="100">
                                            <div id="estimate_d5_r">
                                                <input type="radio" id="estimate_d5_ra" name="estimate_d5_r" onchange="verify_estimate('estimate_d5')"/><label for="estimate_d5_ra">A</label>
                                                <input type="radio" id="estimate_d5_ri" name="estimate_d5_r" onchange="verify_estimate('estimate_d5')"/><label for="estimate_d5_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d5" name="estimate_d5" disabled <?php echo isset($est['estimate_d5'])? ($est['estimate_d5'] == "true"? "checked": "") : "" ?>></td>
                                       <td>5. ผู้ป่วยที่มีอาการทางระบบประสาทดีขึ้นเองอย่างมากในเวลาอันรวดเร็ว หรือมีอาการน้อยก่อให้เกิดความพิการที่ไม่รุนแรง เช่น ชา เล็กน้อยเพียงอย่างเดียว</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d6_tro">
                                       <td width="100">
                                            <div id="estimate_d6_r">
                                                <input type="radio" id="estimate_d6_ra" name="estimate_d6_r" onchange="verify_estimate('estimate_d6')"/><label for="estimate_d6_ra">A</label>
                                                <input type="radio" id="estimate_d6_ri" name="estimate_d6_r" onchange="verify_estimate('estimate_d6')"/><label for="estimate_d6_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d6" name="estimate_d6" disabled <?php echo isset($est['estimate_d6'])? ($est['estimate_d6'] == "true"? "checked": "") : "" ?>></td>
                                       <td>6. มีอาการชักแต่เริ่มแรก</td>
                                   </tr>
                                   <tr id="estimate_d7_tro">
                                       <td width="100">
                                            <div id="estimate_d7_r">
                                                <input type="radio" id="estimate_d7_ra" name="estimate_d7_r" onchange="verify_estimate('estimate_d7')"/><label for="estimate_d7_ra">A</label>
                                                <input type="radio" id="estimate_d7_ri" name="estimate_d7_r" onchange="verify_estimate('estimate_d7')"/><label for="estimate_d7_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d7" name="estimate_d7" disabled <?php echo isset($est['estimate_d7'])? ($est['estimate_d7'] == "true"? "checked": "") : "" ?>></td>
                                       <td>7. มีประวัติกล้ามเนื้อหัวใจขาดเลือดเฉียบพลันในช่วงเวลาอันใกล้</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d8_tro">
                                       <td width="100">
                                            <div id="estimate_d8_r">
                                                <input type="radio" id="estimate_d8_ra" name="estimate_d8_r" onchange="verify_estimate('estimate_d8')"/><label for="estimate_d8_ra">A</label>
                                                <input type="radio" id="estimate_d8_ri" name="estimate_d8_r" onchange="verify_estimate('estimate_d8')"/><label for="estimate_d8_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d8" name="estimate_d8" disabled <?php echo isset($est['estimate_d8'])? ($est['estimate_d8'] == "true"? "checked": "") : "" ?>></td>
                                       <td>8. ความดันโลหิตช่วงก่อนให้การรักษาสูงโดยความดันซิสโตลิคสูงกว่า 185 มม.ปรอทหรือความดันไดแอสโตลิคสูงกว่า 110 มม.ปรอท</td>
                                   </tr>
                                   <tr id="estimate_d9_tro">
                                       <td width="100">
                                            <div id="estimate_d9_r">
                                                <input type="radio" id="estimate_d9_ra" name="estimate_d9_r" onchange="verify_estimate('estimate_d9')"/><label for="estimate_d9_ra">A</label>
                                                <input type="radio" id="estimate_d9_ri" name="estimate_d9_r" onchange="verify_estimate('estimate_d9')"/><label for="estimate_d9_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d9" name="estimate_d9" disabled <?php echo isset($est['estimate_d9'])? ($est['estimate_d9'] == "true"? "checked": "") : "" ?>></td>
                                       <td>9. มีระดับน้ำตาลในเลือดต่ำกว่า 50 มก/ดล. หรือสูงกว่า 400 มก/ดล.</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d10_tro">
                                       <td width="100">
                                            <div id="estimate_d10_r">
                                                <input type="radio" id="estimate_d10_ra" name="estimate_d10_r" onchange="verify_estimate('estimate_d10')"/><label for="estimate_d10_ra">A</label>
                                                <input type="radio" id="estimate_d10_ri" name="estimate_d10_r" onchange="verify_estimate('estimate_d10')"/><label for="estimate_d10_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d10" name="estimate_d10" disabled <?php echo isset($est['estimate_d10'])? ($est['estimate_d10'] == "true"? "checked": "") : "" ?>></td>
                                       <td>10. มีปริมาณเกล็ดเลือดน้อยกว่า 100,000/mm3</td>
                                   </tr>
                                   <tr id="estimate_d11_tro">
                                       <td width="100">
                                            <div id="estimate_d11_r">
                                                <input type="radio" id="estimate_d11_ra" name="estimate_d11_r" onchange="verify_estimate('estimate_d11')"/><label for="estimate_d11_ra">A</label>
                                                <input type="radio" id="estimate_d11_ri" name="estimate_d11_r" onchange="verify_estimate('estimate_d11')"/><label for="estimate_d11_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d11" name="estimate_d11" disabled <?php echo isset($est['estimate_d11'])? ($est['estimate_d11'] == "true"? "checked": "") : "" ?>></td>
                                       <td>11. ได้รับยา heparin ภายใน 48 ชั่วโมงและมีค่า partial thromboplastin time(PTT) ผิดปกติ</td>
                                   </tr>
                                   <tr bgcolor="#E4E4E4" id="estimate_d12_tro">
                                       <td width="100">
                                            <div id="estimate_d12_r">
                                                <input type="radio" id="estimate_d12_ra" name="estimate_d12_r" onchange="verify_estimate('estimate_d12')"/><label for="estimate_d12_ra">A</label>
                                                <input type="radio" id="estimate_d12_ri" name="estimate_d12_r" onchange="verify_estimate('estimate_d12')"/><label for="estimate_d12_ri">I</label>
                                            </div>
                                       </td>
                                       <td><input type="checkbox" id="estimate_d12" name="estimate_d12" disabled <?php echo isset($est['estimate_d12'])? ($est['estimate_d12'] == "true"? "checked": "") : "" ?>></td>
                                       <td>12. ได้รับยาต้านการแข็งตัวของเลือดโดยมีค่า protrombin time(PT) มากกว่า 15 วินาที หรือมีค่า international normalized ratio (INR) มากกว่า 1.7 </td>
                                   </tr>
                                   <tr>
                                    <td><input type="button" id="estimate_confirm" onclick="estimate_updatec()" value="Confirm"></td>
                                </tr>
                            </table>
                            <br>
                            <table width="100%" class="ui-widget ui-widget-content ui-corner-all" >
                            <tr class="ui-widget-header "><td colspan="3">อธิบายเหตุผล</td></tr>

                            <tr><td align="left">
                                    <div id="estimate_reason" class="2"><?php echo isset($est['estimate_reason'])? $est['estimate_reason'] : "" ?></div>
                                </td></tr>

                            </table>
                        </div>
                        
                        <div id="tabs-6">
                        <table class="ui-widget ui-widget-content ui-corner-all" width="90%">
                            <thead>
                                <tr class="ui-widget-header">
                                   <td>Management</td>
                                </tr>
                            </thead>
                            <tr>
                                <td><br>
                                    <u><b>Initial Management</b></u><br>
                                    <table width="500" align="left">
                                        <tr><td width="10"></td>
                                            <td colspan="2"><input type="checkbox" id="im_IVfluidYN" name="im_IVfluidYN" disabled <?php echo isset($mng['im_IVfluidYN'])? ($mng['im_IVfluidYN'] == "true"? "checked": "") : "" ?>>IV fluid</td>
                                        </tr>
                                        <tr><td></td><td colspan="2"><input type="checkbox" id="im_O2CanulaYN" name="im_O2CanulaYN" disabled <?php echo isset($mng['im_O2CanulaYN'])? ($mng['im_O2CanulaYN'] == "true"? "checked": "") : "" ?>>O2 Canula</td></tr>
                                        <tr><td></td><td colspan="2"><input type="checkbox" id="im_IntubationYN" name="im_IntubationYN"  disabled <?php echo isset($mng['im_IntubationYN'])? ($mng['im_IntubationYN'] == "true"? "checked": "") : "" ?>>Intubation</td></tr>
                                        <tr><td></td><td width="90"><input type="checkbox" id="im_OtherYn" name="im_OtherYn" disabled <?php echo isset($mng['im_OtherYn'])? ($mng['im_OtherYn'] == "true"? "checked": "") : "" ?>>Other </td>
                                            <td><div id="im_OtherTxt" class="d2"><?php echo isset($mng['im_OtherTxt'])? $mng['im_OtherTxt'] : "" ?></div></td></tr>
                                    </table></td>
                            </tr>
                            <tr>
                                <td><br>
                                    <u><b>Suggented Management</b></u><br>                                    
                                    <table width="600" align="left">
                                        <tr><td width="10"></td><td><input type="checkbox" id="sm_IVTYn" name="sm_IVTYn" <?php echo isset($mng['sm_IVTYn'])? ($mng['sm_IVTYn'] == "true"? "checked": "") : "" ?>>IV Thrombolysis เริ่มเวลา <input type="text" id="sm_IVTStartTime" value="<?php echo isset($mng['sm_IVTStartTime'])? $mng['sm_IVTStartTime'] : "" ?>"></td></tr>
                                        <tr><td></td><td><input type="checkbox" id="sm_NIVTYn" name="sm_NIVTYn" <?php echo isset($mng['sm_NIVTYn'])? ($mng['sm_NIVTYn'] == "true"? "checked": "") : "" ?>>No IV Thormbolysis เนื่องจาก <input type="text" id="sm_NIVTC" value="<?php echo isset($mng['sm_NIVTC'])? $mng['sm_NIVTC'] : "" ?>"></td></tr>
                                        <tr><td></td><td><input type="checkbox" id="sm_OtherYN" name="sm_OtherYN" <?php echo isset($mng['sm_OtherYN'])? ($mng['sm_OtherYN'] == "true"? "checked": "") : "" ?>>Other <input type="text" id="sm_OtherTxt" value="<?php echo isset($mng['sm_OtherTxt'])? $mng['sm_OtherTxt'] : "" ?>"></td></tr>
                                        <tr><td colspan="5"><input id="smBtn" type="button" value="Save" onclick="sm_save()"></td>
                                    </table>
                                    </td>
                            </tr>

                        </table>
                    </div>
                    <div id="tabs-7">
                        <table width="300" class="ui-widget ui-widget-content ui-corner-all">
                            <thead><tr class="ui-widget-header"><td colspan="3" align="center">
                                        <table><tr><td>
                                                    <?php echo  html::image('assets/icon/user_48.png',array('width' => '48', 'height' => '48')) ?>

                                                </td>
                                                <td align="center"  valign="middle">
                                                    ข้อมูลคนไข้</td></tr></table></td>
                                </tr>
                            </thead>
                            <tr><td width="150">ชื่อ</td><td><?php echo $patient['p_fname'] ?></td></tr>
                            <tr><td>นามสกุล</td><td><?php echo $patient['p_lname'] ?></td></tr>
                            <tr><td>เพศ</td><td><?php echo $patient['p_sex']==1?"ชาย":"หญิง" ?></td></tr>
                            <tr><td>วันเดือนปีเกิด</td><td><?php echo $patient['p_bday'] ?></td></tr>
                            <tr><td>ที่อยู่</td><td><?php echo $patient['p_address'] ?></td></tr>
                            <tr><td>เบอร์โทรศัพท์</td><td><?php echo $patient['p_phone'] ?></td></tr>
                        </table>
                    </div>
                    </div>
                    <table width="100%"><tr><td align="center" colspan="3"></td></tr></table>
                </td>
            </tr>
        </table>
</form>


